<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>我是父组件</h1>
        配偶：<input type="text" v-model='wife'>
        <hr>
        <Son :mother='wife'></Son>

    </div>

    <script src="../hmpc-72/node_modules/vue/dist/vue.js"></script>

    <script>
        Vue.component('Son',{
            template:`
            <div>
                <h3></h3>
                    <p></p>
                    <button @click='fn'>修改-换妈</button>
                </div>
            `,
            props:['mother'],
            methods: {
                fn(){
                    this.mother='巧碧螺'
                }
            }
        })
        const vm = new Vue({
            el:'#app',
            data:{
                wife:''
            }
        })
    </script>
</body>
</html>